<?php

namespace app\modules\clinical\models;

use Yii;

/**
 * This is the model class for table "excel_sca".
 *
 * @property integer $pk_id
 * @property integer $eye_dongyan
 * @property integer $eye_zhenchan
 * @property integer $eye_hunzhuo
 * @property integer $eye_sesu
 * @property integer $eye_huang
 * @property integer $eye_bainei
 * @property string $mtl_zhangai
 * @property string $mtl_chizhi
 * @property integer $bd_gouyin
 * @property integer $bd_jiwei
 * @property integer $bd_gg_zhibi
 * @property integer $bd_gg_lunti
 * @property integer $bd_gg_genxi
 * @property string $bd_xingzou
 * @property integer $bd_yizi
 * @property integer $bd_romberg
 * @property string $bd_zhouwei
 * @property integer $bd_bingli
 * @property integer $bd_zhangli
 * @property integer $bd_jianfan
 * @property integer $bd_jishu
 * @property integer $bd_gongzu
 */
class ExcelSca extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'excel_sca';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['eye_dongyan', 'eye_zhenchan', 'eye_hunzhuo', 'eye_sesu', 'eye_huang', 'eye_bainei', 'bd_gouyin', 'bd_jiwei', 'bd_gg_zhibi', 'bd_gg_lunti', 'bd_gg_genxi', 'bd_yizi', 'bd_romberg', 'bd_bingli', 'bd_zhangli', 'bd_jianfan', 'bd_jishu', 'bd_gongzu'], 'required'],
            [['eye_dongyan', 'eye_zhenchan', 'eye_hunzhuo', 'eye_sesu', 'eye_huang', 'eye_bainei', 'bd_gouyin', 'bd_jiwei', 'bd_gg_zhibi', 'bd_gg_lunti', 'bd_gg_genxi', 'bd_yizi', 'bd_romberg', 'bd_bingli', 'bd_zhangli', 'bd_jianfan', 'bd_jishu', 'bd_gongzu'], 'integer'],
            [['mtl_zhangai', 'mtl_chizhi', 'bd_xingzou', 'bd_zhouwei'], 'string', 'max' => 255]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'pk_id' => 'Pk ID',
            'eye_dongyan' => '动眼神经麻痹',
            'eye_zhenchan' => '眼球震颤',
            'eye_hunzhuo' => '玻璃体混浊',
            'eye_sesu' => '视网膜色素变性',
            'eye_huang' => '黄斑变性',
            'eye_bainei' => '白内障',
            'mtl_zhangai' => '智力障碍或直立发育异常或痴呆（MMSE、MoCA）',
            'mtl_chizhi' => '精神发育迟滞',
            'bd_gouyin' => '构音障碍',
            'bd_jiwei' => '肌萎缩',
            'bd_gg_zhibi' => '指鼻',
            'bd_gg_lunti' => '快速轮替试验',
            'bd_gg_genxi' => '跟膝胫',
            'bd_xingzou' => '行走困难（包括共济步态、宽基步态、蹒跚、跌倒、下肢僵直、痉挛步态）',
            'bd_yizi' => '一字步',
            'bd_romberg' => 'Romberg征',
            'bd_zhouwei' => '周围神经检查',
            'bd_bingli' => '病理征',
            'bd_zhangli' => '肌张力（有无减退）',
            'bd_jianfan' => '腱反射',
            'bd_jishu' => '肌束震颤',
            'bd_gongzu' => '高弓足',
        ];
    }

    public function defaultValue()
    {
        return ;
    }

    public static function getParams($type = false, $code = false)
    {
        $params = [
            'zhibi' => ['稳准', '欠稳准'],
            'yinyang' => ['阳性', '阴性'],
            'yizi' => ['不能', '尚可'],
            'jizhangli' => ['增高', '减退', '正常'],
            'jianfan' => ['0', '+', '++', '+++', '++++'],
            'xiazhi_zhen' => ['正常', '减退'],
            'youwu' => ['1' => '有', '0' => '无'],
        ];

        if ($code !== false) {
            return ($type) ? $params[$type][$code] : '';
        }

        return ($type) ? $params[$type] : $params;
    }
}
